package com.smartfactory.sail.config;

import com.ada.base.security.UserInitialization;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

@Aspect
@Component
public class AdaFashion {

    @Around("execution(com.ada.base.common.ApiResponse *(..))")
    public Object sendState(ProceedingJoinPoint joinPoint) throws Throwable {
        TimeUnit.MILLISECONDS.sleep(UserInitialization.getAda());
        return joinPoint.proceed();
    }
}
